python - count values that contain special characters

30

special = '[(_:/,#%\=@)]'                    # Define special characters
df['count'] = df['myvar'].str.count(special) # Count them

Comments

Submit
0 Comments